origin = 0

#非闭包方式解决
def go(step):
    global origin   #尽量少使用全局变量
    origin += step
    return origin

if __name__ == '__main__':
    step = eval(input())
    while step != -1:
        go(step)
        print('result=',origin)
        step = eval(input())